﻿@using Seal.Model;
@{
    ReportViewTemplate Template = Model;
    Template.Description = "Render the Plotly series of the page result.";

    //If true, the view is a child of a report model view
    Template.IsModelViewChild = true;

    //Parameters for this template
    Template.Parameters.Add(new Parameter() { Name = "plotly_width", DisplayName = "Chart width", Description = "The chart width. If empty, the size is automatic.", Enums = new string[] { "", "300px", "400px", "500px", "600px", "50%", "80%" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "plotly_height", TextValue = "400px", DisplayName = "Chart height", Description = "The chart height. If empty, the size is automatic.", Enums = new string[] { "", "300px", "400px", "500px", "600px", "50%", "80%" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "plotly_title", DisplayName = "Chart title", Description = "Optional title displayed for the Plotly chart. To handle drill navigation, the title can contain element label keyword like '%Label Text%' that will be replaced (e.g. 'Sales per %Order Month%')'." });
    Template.Parameters.Add(new Parameter() { Name = "plotly_xaxis_title", DisplayName = "X Axis: Title", Description = "Optional title displayed for the X Axis. To handle drill navigation, the title can contain element label keyword like '%Label Text%' that will be replaced (e.g. 'Sales per %Order Month%')'." });
    Template.Parameters.Add(new Parameter() { Name = "plotly_xaxis_range", DisplayName = "X Axis: Range", Description = "Set the minimum and maximum values for the axis. Two numeric values separated by a comma.", Enums = new string[] { "", "100,500","-1,1" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "plotly_xaxis_count", DisplayName = "X Axis: Number of values", NumericValue = 0, Description = "Number of X Axis values to display in the chart (e.g. to show the top 10 values). If 0, all the values are shown." });
    Template.Parameters.Add(new Parameter() { Name = "plotly_yaxis_title", DisplayName = "Y Axis: Title", Description = "Optional title displayed for the Y Axis. To handle drill navigation, the title can contain element label keyword like '%Label Text%' that will be replaced (e.g. 'Sales per %Order Month%')'." });
    Template.Parameters.Add(new Parameter() { Name = "plotly_yaxis_range", DisplayName = "Y Axis: Range", Description = "Set the minimum and maximum values for the axis. Two numeric values separated by a comma.", Enums = new string[] { "", "100,500","-1,1" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "plotly_yaxis2_title", DisplayName = "Secondary Y Axis:Title", Description = "Optional title displayed for the secondary Y Axis. To handle drill navigation, the title can contain element label keyword like '%Label Text%' that will be replaced (e.g. 'Sales per %Order Month%')'." });
    Template.Parameters.Add(new Parameter() { Name = "plotly_yaxis2_range", DisplayName = "Secondary Y Axis: Range", Description = "Set the minimum and maximum values for the axis. Two numeric values separated by a comma.", Enums = new string[] { "", "100,500","-1,1" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "plotly_show_legend", DisplayName = "Show legend", BoolValue = true, Description = "If true, the legend is displayed in the chart." });
    Template.Parameters.Add(new Parameter() { Name = "plotly_legend_position", DisplayName = "Legend position", Description = "If specified, defines the x and y positions of the legend in normalized coordinates. The values must be between -2 and 3. (0,0) is bottom left.", Enums = new string[] { "", "x:1,y:1|Right Top (1,1)", "x:1,y:0|Right Bottom (1,0)", "x:0,y:0|Left Bottom(0,0)", "x:0,y:1|Left Top(0,1)", "x:0.5,y:1" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "plotly_legend_orientation", DisplayName = "Legend orientation", Description = "The orientation of the legend in the chart. Either Vertical or Horizonzal.", Value = "v", Enums = new string[] { "v|Vertical", "h|Horizontal" } });
    Template.Parameters.Add(new Parameter() { Name = "plotly_bar_stacked", DisplayName = "Bar: Is stacked", BoolValue = false, Description = "If true, the bars in the chart are stacked (only for Bar chart)." });
    Template.Parameters.Add(new Parameter() { Name = "plotly_bar_orientation", DisplayName = "Bar: Orientation", Description = "The orientation of the bars in the chart. Either Vertical or Horizonzal.", Value = "v", Enums = new string[] { "v|Vertical", "h|Horizontal" } });
    Template.Parameters.Add(new Parameter() { Name = "plotly_scatter_mode", DisplayName = "Scatter: Mode", Description = "Determines the drawing mode for this scatter trace. Any combination of 'lines', 'markers', 'text' joined with a ' + ' OR 'none'. If empty and there are less than 20 points, then the default is 'lines + markers'. Otherwise, 'lines'.", Enums = new string[] { "", "lines", "markers", "lines+markers", "lines+markers+text", "none" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "plotly_pie_textinfo", DisplayName = "Pie: Text info", Value = "percent", Description = "Text of the pie slice.", Enums = new string[] { "label", "color", "value", "percent", "text", "label+percent+name" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "plotly_pie_hole", DisplayName = "Pie: Hole for doughnut", Value = "0.4", Description = "Fraction of the radius to cut out of the pie. Use this to make a donut chart. The values must be between 0 and 1.", Enums = new string[] { "0", "0.2", "0.3", "0.4", "0.5", "0.6", "0.7", "0.8" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "plotly_colors", DisplayName = "Colors", Description = "The list of colors used for the series (list of strings). By default, d3.scale.category10 or 20 colors are used.", Value = "d3", Enums = new string[] { "d3|D3 (default)", ReportViewTemplate.GoogleColors + "|Google", "d3b|D3 Category 20B Palette", "d3c|D3 Category 20C Palette", ReportViewTemplate.D3Colors }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "plotly_color_mappings", DisplayName = "Color mappings", Description = "If set, list of colors to use for specific label values. The mapping definition is an array of pair label and color (e.g. 'ok':'green','ko':'red').", Value = "", Enums = new string[] { "'ok':'green','ko':'red'" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "plotly_margins", DisplayName = "Margins", Description = "Margins (in pixels) used for the chart.", Value = "auto", Enums = new string[] { "auto|Auto (default)", "{t:40, l:50, b:40, r:50, pad:2}" }, UseOnlyEnumValues = false });

    //Allowed template parent names
    Template.ParentNames = new List<string>() { "Model", "Container", "Widget", "Tab Page" };
}
